package com.mapper;

import com.entity.TbStudent;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

public interface TbStudentMapper {

    TbStudent selectByStudentCode(@Param("studentCode")String studentCode);

    List<TbStudent> listByClassCode(Map<String, String> params);

    @Select("select * from tb_student")
    List<TbStudent> listAll();

    @Insert("insert tb_student(class_code, student_code, student_name) value (#{classCode}, #{studentCode}, #{studentName})")
    void insert(TbStudent tbStudent);

    @Update("update tb_student set student_name = #{studentName} where student_code = #{studentCode}")
    void update(TbStudent tbStudent);

    @Delete("delete from tb_student where student_code = #{studentCode}")
    void delete(@Param("studentCode")String studentCode);
}
